-
-
Notifications
You must be signed in to change notification settings - Fork 946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Task notification plugin #1343
Task notification plugin #1343
Conversation
Hey thanks @Kathenae this looks great! I will need a few days to look over this as I realized that the plugin interface currently lacks a way to communicate whether a plugin is active/inactive, so if I disable the plugin it will continue to intercept the task_* notifications (even though it shouldn't). Also open to suggestions on how to tackle this. |
Alright thanks for taking that time! As for the active/inactive state maybe
have plugins implement an on_active_state_changed function that is called
whenever the active inactive state is changed and have the plugins call
whatever setup/cleanup code that needs to called? so thats where the
signals could be unregistered for example?
…On Thu, May 18, 2023 at 10:10 PM Piero Toffanin ***@***.***> wrote:
Hey thanks @Kathenae <https://github.com/Kathenae> this looks great! I
will need a few days to look over this as I realized that the plugin
interface currently lacks a way to communicate whether a plugin is
active/inactive, so if I disable the plugin it will continue to intercept
the task_* notifications (even though it shouldn't).
Also open to suggestions on how to tackle this.
—
Reply to this email directly, view it on GitHub
<#1343 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AU5FUKYVOEUIECJGDB7E6EDXGZ64LANCNFSM6AAAAAAYGXFJ6E>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
…kathenae-task_notification_plugin
In the spirit of keeping things simple, I've opted to tweak Thanks for the wonderful plugin @Kathenae 🙏 |
Yeah, this approach is much better, avoids having to register/deregister signals across processes, which I'm not sure would have worked. Always glad to help! thank you for all the awesome work you doing maintaining this project @pierotofy |
Task notification plugin
This pull request adds a new plugin to the application that provides email notifications for task completion, failure, and removal. The plugin can be accessed from the "Task Notification" tab on the main menu and allows users to configure the SMTP server settings and enable/disable notifications for different events.
Changes:
app/models/task.py
andapp/plugins/signals.py
to send a signal whenever a task fails during processingTask Notification
that allows users to configure SMTP server settings and enable/disable notifications for task completion, failure, and removal.ConfigurationForm
class incoreplugins/tasknotification/plugin.py
that defines the form fields for SMTP server settings and notification options.coreplugins/tasknotification/config.py
module that provides methods for loading and saving SMTP server settings from a configuration file.coreplugins/tasknotification/email.py
module that defines asend()
function for sending email notifications using the SMTP server settings.coreplugins/tasknotification/signals.py
module to include event handlers for task completion, failure, and removal that use thesend()
function to send email notifications if the corresponding notification option is enabled in the plugin configuration.Note: Configuration settings are saved in a
.conf
file on the plugin directory, and it is .gitignored since the raw password and other potentially sensitive configuration info is being saved.This is related to this issue #1341 where an email plugin was considered along with improvements to the existing diagnostics plugin (see PR #1344)